package com.itwn.service;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.itwn.entity.User;
import com.itwn.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class UserService {
    @Autowired
    UserMapper usermapper;

    public PageInfo<User> showUserList(Integer pageNum, Integer pageSize, String userName) {
        PageHelper.startPage(pageNum,pageSize);
       List<User> list = usermapper.selectAllByCons(userName);
        return new PageInfo<>(list);
    }

    public void deleteUser(Integer userId) {
        usermapper.deleteUserByUpdate(userId);
    }
}
